package com.aaa.member.controller;

import com.aaa.member.service.MemberLoginService;
import com.aaa.member.util.UserAgentUtils;
import com.aaa.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author 崔灿
 * @Date 2023/03/03 10:46
 * @ClassName MemberLoginController
 * @Description
 * @Version 1.0
 */

@Api(value = "/memberlogin/memberlogin", tags = {"会员登陆"})
@RestController
@RequestMapping("/memberlogin/memberlogin")
public class MemberLoginController {
    @Autowired
    private MemberLoginService memberLoginService;

    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "HttpServletRequest", name = "request", value = "", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "string", name = "username", value = "", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "string", name = "password", value = "", required = true)
    })
    @ApiOperation(value = "", notes = "", httpMethod = "POST")
    @PostMapping("/memberlogin")
    public Result memberlogin(HttpServletRequest request ,String username, String password){
        return memberLoginService.login(request,username,password);
    }
}
